home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form NumCrunch
- BackColor = &H00FFFFFF&
- Caption = "Number Crunch"
- ClientHeight = 5010
- ClientLeft = 405
- ClientTop = 1425
- ClientWidth = 8910
- ForeColor = &H00000000&
- Height = 5700
- Icon = NOCRUNCH.FRX:0000
- Left = 345
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 5010
- ScaleWidth = 8910
- Top = 795
- Width = 9030
- Begin Timer Timer1
- Enabled = 0 'False
- Interval = 1000
- Left = 480
- Top = 2880
- End
- Begin CommandButton Command1
- Caption = "Start Timer"
- Height = 615
- Left = 6720
- TabIndex = 42
- Top = 2160
- Width = 2055
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 20
- Left = 7920
- TabIndex = 39
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 19
- Left = 7080
- TabIndex = 38
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 18
- Left = 6240
- TabIndex = 37
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 17
- Left = 5400
- TabIndex = 36
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 16
- Left = 4560
- TabIndex = 35
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 15
- Left = 3720
- TabIndex = 34
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 14
- Left = 2880
- TabIndex = 33
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 13
- Left = 2040
- TabIndex = 32
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 12
- Left = 1200
- TabIndex = 31
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 11
- Left = 360
- TabIndex = 30
- Top = 4080
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 10
- Left = 7920
- TabIndex = 29
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 9
- Left = 7080
- TabIndex = 28
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 8
- Left = 6240
- TabIndex = 27
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 7
- Left = 5400
- TabIndex = 26
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 6
- Left = 4560
- TabIndex = 25
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 5
- Left = 3720
- TabIndex = 24
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 4
- Left = 2880
- TabIndex = 23
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 3
- Left = 2040
- TabIndex = 22
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 2
- Left = 1200
- TabIndex = 21
- Top = 3360
- Width = 735
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FF0000&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 615
- Index = 1
- Left = 360
- TabIndex = 20
- Top = 3360
- Width = 735
- End
- Begin Label timebox
- Caption = "120"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 18
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 495
- Left = 5520
- TabIndex = 41
- Top = 2280
- Width = 975
- End
- Begin Label Label2
- Caption = "Time Remaining (seconds):"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 18
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 495
- Left = 240
- TabIndex = 40
- Top = 2280
- Width = 5055
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "20"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 20
- Left = 7920
- TabIndex = 19
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "19"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 19
- Left = 7080
- TabIndex = 18
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "18"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 18
- Left = 6240
- TabIndex = 17
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "17"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 17
- Left = 5400
- TabIndex = 16
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "16"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 16
- Left = 4560
- TabIndex = 15
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "15"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 15
- Left = 3720
- TabIndex = 14
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "14"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 14
- Left = 2880
- TabIndex = 13
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "13"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 13
- Left = 2040
- TabIndex = 12
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "12"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 12
- Left = 1200
- TabIndex = 11
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "11"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 11
- Left = 360
- TabIndex = 10
- Top = 1080
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "10"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 10
- Left = 7920
- TabIndex = 9
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "9"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 9
- Left = 7080
- TabIndex = 8
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "8"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 8
- Left = 6240
- TabIndex = 7
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "7"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 7
- Left = 5400
- TabIndex = 6
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "6"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 6
- Left = 4560
- TabIndex = 5
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "5"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 5
- Left = 3720
- TabIndex = 4
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "4"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 4
- Left = 2880
- TabIndex = 3
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "3"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 3
- Left = 2040
- TabIndex = 2
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "2"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 2
- Left = 1200
- TabIndex = 1
- Top = 360
- Width = 735
- End
- Begin Label numbox
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "1"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 615
- Index = 1
- Left = 360
- TabIndex = 0
- Top = 360
- Width = 735
- End
- Begin Menu game
- Caption = "&Game"
- Begin Menu new
- Caption = "&New"
- Shortcut = {F2}
- End
- Begin Menu ex
- Caption = "E&xit"
- Shortcut = ^X
- End
- Begin Menu dash
- Caption = "-"
- End
- Begin Menu abt
- Caption = "&About Number Crunch..."
- End
- End
- Begin Menu options
- Caption = "&Options"
- Begin Menu level
- Caption = "&Game Type"
- Begin Menu kids
- Caption = "&Kids' Game"
- End
- Begin Menu norm
- Caption = "&Normal Game"
- Checked = -1 'True
- End
- End
- Begin Menu timelimit
- Caption = "&Set Time Limit..."
- End
- Begin Menu bkdcol
- Caption = "&Background Color"
- Begin Menu yellow
- Caption = "&Yellow"
- End
- Begin Menu green
- Caption = "&Green"
- End
- Begin Menu blue
- Caption = "&Blue"
- End
- Begin Menu purple
- Caption = "&Purple"
- End
- Begin Menu bluegray
- Caption = "Blue-gr&ay"
- End
- Begin Menu gray
- Caption = "G&ray"
- End
- Begin Menu white
- Caption = "&White"
- Checked = -1 'True
- End
- End
- End
- Begin Menu help
- Caption = "&Help"
- End
- Sub abt_Click ()
- Load about
- about.Show
- End Sub
- Sub blue_Click ()
- yellow.checked = 0
- green.checked = 0
- blue.checked = -1
- purple.checked = 0
- bluegray.checked = 0
- gray.checked = 0
- white.checked = 0
- numCrunch.backcolor = &HFFFF00
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
- Sub bluegray_Click ()
- yellow.checked = 0
- green.checked = 0
- blue.checked = 0
- purple.checked = 0
- bluegray.checked = -1
- gray.checked = 0
- white.checked = 0
- numCrunch.backcolor = &H808000
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
- Sub Command1_Click ()
- timer1.enabled = -1
- command1.enabled = 0
- End Sub
- Sub ex_Click ()
- Unload numCrunch
- End Sub
- Sub Form_Load ()
- Randomize
- Static t(1 To 20)
- amttime = 120
- For n = 1 To 20
- Do
- t(n) = Int(20 * Rnd + 1)
- For u = 1 To 20
- If num(u) = t(n) Then u = 456: Exit For
- Next u
- If u = 21 Then Exit Do
- Loop
- num(n) = t(n)
- Next n
- End Sub
- Sub gray_Click ()
- yellow.checked = 0
- green.checked = 0
- blue.checked = 0
- purple.checked = 0
- bluegray.checked = 0
- gray.checked = -1
- white.checked = 0
- numCrunch.backcolor = &HC0C0C0
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
- Sub green_Click ()
- yellow.checked = 0
- green.checked = -1
- blue.checked = 0
- purple.checked = 0
- bluegray.checked = 0
- gray.checked = 0
- white.checked = 0
- numCrunch.backcolor = &HFF00&
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
- Sub help_Click ()
- MsgBox "For help on Number Crunch, please use Windows Notepad to open the file NOCRUNCH.TXT.", 64, "Number Crunch"
- End Sub
- Sub kids_Click ()
- l = 1
- kids.checked = -1
- norm.checked = 0
- For o = 1 To 20
- numbox(o).caption = ""
- Next o
- Static t(1 To 20)
- timer1.enabled = 0
- command1.enabled = -1
- timebox.caption = Str$(amttime)
- For w = 1 To 20
- num(w) = 0
- Next w
- For n = 1 To 20
- Do
- t(n) = Int(20 * Rnd + 1)
- For u = 1 To 20
- If num(u) = t(n) Then u = 456: Exit For
- Next u
- If u = 21 Then Exit Do
- Loop
- num(n) = t(n)
- Next n
- For x = 1 To 20
- label1(x).visible = -1
- label1(x).caption = ""
- label1(x).dragmode = 0
- numbox(x).backcolor = &HFFFFFF
- numbox(x).forecolor = &H0&
- Next x
- End Sub
- Sub Label1_Click (index As Integer)
- If timer1.enabled = 0 Then Beep: Exit Sub
- For g = 1 To 20
- If label1(g).caption <> "" Then
- label1(g).caption = ""
- label1(g).dragmode = 0
- End If
- Next g
- label1(index).caption = Str$(num(index))
- label1(index).dragmode = 1
- End Sub
- Sub new_Click ()
- Static t(1 To 20)
- timer1.enabled = 0
- command1.enabled = -1
- timebox.caption = Str$(amttime)
- For w = 1 To 20
- num(w) = 0
- Next w
- If l = 1 Then
- For z = 1 To 20
- numbox(z).caption = ""
- Next z
- End If
- For n = 1 To 20
- Do
- t(n) = Int(20 * Rnd + 1)
- For u = 1 To 20
- If num(u) = t(n) Then u = 456: Exit For
- Next u
- If u = 21 Then Exit Do
- Loop
- num(n) = t(n)
- Next n
- For x = 1 To 20
- label1(x).visible = -1
- label1(x).caption = ""
- label1(x).dragmode = 0
- numbox(x).backcolor = &HFFFFFF
- numbox(x).forecolor = &H0&
- Next x
- End Sub
- Sub norm_Click ()
- l = 0
- norm.checked = -1
- kids.checked = 0
- For o = 1 To 20
- numbox(o).caption = Str$(o)
- Next o
- Static t(1 To 20)
- timer1.enabled = 0
- command1.enabled = -1
- timebox.caption = Str$(amttime)
- For w = 1 To 20
- num(w) = 0
- Next w
- For n = 1 To 20
- Do
- t(n) = Int(20 * Rnd + 1)
- For u = 1 To 20
- If num(u) = t(n) Then u = 456: Exit For
- Next u
- If u = 21 Then Exit Do
- Loop
- num(n) = t(n)
- Next n
- For x = 1 To 20
- label1(x).visible = -1
- label1(x).caption = ""
- label1(x).dragmode = 0
- numbox(x).backcolor = &HFFFFFF
- numbox(x).forecolor = &H0&
- Next x
- End Sub
- Sub numbox_DragDrop (index As Integer, source As Control, x As Single, Y As Single)
- If l = 0 And index > 1 Then
- If numbox(index - 1).backcolor <> &HFF& Then Beep: source.dragmode = 0: Exit Sub
- End If
- q = source.index
- If num(q) <> index Then
- Beep: source.dragmode = 0: Exit Sub
- numbox(index).backcolor = &HFF&
- numbox(index).forecolor = &HFFFFFF
- numbox(index).caption = Str$(index)
- source.visible = 0
- source.dragmode = 0
- For u = 1 To 20
- If numbox(u).backcolor <> &HFF& Then Exit For
- Next u
- If u = 21 Then
- timer1.enabled = 0
- f = amttime - Val(timebox.caption)
- message$ = "You won in " + Str$(f) + " seconds!"
- MsgBox message$, 48, "Number Crunch"
- End If
- End If
- End Sub
- Sub purple_Click ()
- yellow.checked = 0
- green.checked = 0
- blue.checked = 0
- purple.checked = -1
- bluegray.checked = 0
- gray.checked = 0
- white.checked = 0
- numCrunch.backcolor = &HFF00FF
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
- Sub timelimit_Click ()
- message$ = "Please enter the amount of time you wish to attempt to complete the game in terms of seconds:"
- response$ = InputBox$(message$, "Number Crunch", Str$(amttime))
- If response$ = "" Then response$ = Str$(amttime)
- amttime = Val(response$)
- Static t(1 To 20)
- timer1.enabled = 0
- command1.enabled = -1
- timebox.caption = Str$(amttime)
- For i = 1 To 20
- If l = 1 Then
- numbox(i).caption = ""
- Else
- numbox(i).caption = Str$(i)
- End If
- Next i
- For w = 1 To 20
- num(w) = 0
- Next w
- For n = 1 To 20
- Do
- t(n) = Int(20 * Rnd + 1)
- For u = 1 To 20
- If num(u) = t(n) Then u = 456: Exit For
- Next u
- If u = 21 Then Exit Do
- Loop
- num(n) = t(n)
- Next n
- For x = 1 To 20
- label1(x).visible = -1
- label1(x).caption = ""
- label1(x).dragmode = 0
- numbox(x).backcolor = &HFFFFFF
- numbox(x).forecolor = &H0&
- Next x
- End Sub
- Sub Timer1_Timer ()
- Y = Val(timebox.caption)
- timebox.caption = Str$(Y - 1)
- If Val(timebox.caption) = 0 Then
- timer1.enabled = 0
- For e = 1 To 20
- label1(e).caption = ""
- label1(e).dragmode = 0
- Next e
- MsgBox "I'm sorry, time has run out. Please play again.", 16, "Number Crunch"
- End If
- End Sub
- Sub white_Click ()
- yellow.checked = 0
- green.checked = 0
- blue.checked = 0
- purple.checked = 0
- bluegray.checked = 0
- gray.checked = 0
- white.checked = -1
- numCrunch.backcolor = &HFFFFFF
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
- Sub yellow_Click ()
- yellow.checked = -1
- green.checked = 0
- blue.checked = 0
- purple.checked = 0
- bluegray.checked = 0
- gray.checked = 0
- white.checked = 0
- numCrunch.backcolor = &HFFFF&
- label2.backcolor = numCrunch.backcolor
- timebox.backcolor = numCrunch.backcolor
- End Sub
-